<script type="text/javascript">
    function forgotpass(){
        var url= root+'user/forgotpass';
        var email= $('#email').val();
        if(email)
        {
            $.post(
            url,
            $('#fr_forgot').serialize(),
            function(data){
                if(data.st)
                {
                    console.log(data);
                }
            },'json'
        );
        }
    }
</script>
<form action="" id="fr_forgot" method="post" enctype="multipart/form-data">
    <input type="text" name="email" id="email" /><br>
    <input type="hidden" name="type" value="fb" />
    <input name="btn" value="Login" type="button" onclick="return forgotpass()">
</form>